class Pumpkin extends GuaAnimation {
    static new(game) {
        let p = new this(game, animationPumpkin)
        p.setup()
        return p
    }

    setup() {
        // row表示在草地的第几排
        this.row = -1
        this.cooldown = 5
        this.score = 125
        this.hp = 1000
    }

    remove() {
        this.scene.removeOther(this)
    }

    head1() {
        this.changeAnimation('head1')

    }

    head2() {
        this.changeAnimation('head2')

    }

    damage() {
        this.changeAnimation('damage')

    }


    cracked() {
        this.hp--
        log('this.hp', this.hp)
        // if (this.hp > 300 && this.hp < 600) {
        //     this.damage()
        // }
        if (this.hp > 100 && this.hp < 300) {
            this.head1()
        }
        if (this.hp < 100) {
            this.head2()
        }

        if (this.hp == 0) {
            this.remove()
        }
    }

    update() {
        super.update()
        // this.fire()
    }
}